<?  layout("../layout/default.html") { ?>
<div class="admin-panel">
	<div class="tab">
		<div class="tab-head">
			<strong><? if(@data.isNew()){ ?>添加<? }else{ ?>编辑<?} ?></strong>
			<span class="tab-more"><a href="javascript:history.go(-1)" class="button  button-little bg-blue  icon-step-backward"> 返回</a></span>
			<ul class="tab-nav">
			  <li class="active"><a href="#tab-set">信息</a></li>
			</ul>
		</div>
		<div class="tab-body">
		<script type="text/javascript">
			function check(){
					var str1 = document.getElementById("room_environment").value;
					var str2 = document.getElementById("room_typ").value;
					var str3 = document.getElementById("room_name").value;
					var reg=/[^\u4E00-\u9FA5]/;
					if(str1.match(reg)){
						alert("请输入中文环境");
						document.getElementById("room_environment").value="";
						return false;
					}
					if(str2.match(reg)){
						alert("请输入中文类型");
						document.getElementById("room_typ").value="";
						return false;
					}
					if(str3.length == 0){
						alert("房间名称必须输入");
						return false;
					}
					if(str2.length ==0 ){
						alert("房间类型必须输入");
						return false;
					}
			}
		</script>
			<div class="tab-panel active" id="tab-set">
				<form method="post" class="form-x" action="">
					<div class="form-group">
						<div class="label"><label for="sitename">名称</label></div>
						<div class="field">
						<input type="text" class="input" id="room_name" name="room.name" size="200" placeholder="请填写名称" data-validate="required:请填写名称" value="${data.name!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">城市</label></div>
						<div class="field">
						<input type="text" class="input" id="room_city" name="room.city" size="200" placeholder="请填写城市" data-validate="required:请填写城市" value="${data.city!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">环境</label></div>
						<div class="field">
						<input type="text" class="input" id="room_environment" name="room.environment" size="200" placeholder="请填写环境(酒店/家居/办公室/单品等)" data-validate="required:请填写环境" value="${data.environment!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">类型</label></div>
						<div class="field">
						<input type="text" class="input" id="room_typ" name="room.type" size="200" placeholder="请填写类型(客厅/卧室/办公室/会议室等)" data-validate="required:请填写类型" value="${data.type!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">大楼</label></div>
						<div class="field">
						<input type="text" class="input" id="room_building" name="room.building" size="200" placeholder="请填写大楼" data-validate="required:请填写大楼" value="${data.building!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">楼层</label></div>
						<div class="field">
						<input type="text" class="input" id="room_floor" name="room.floor" size="200" placeholder="请填写楼层" data-validate="required:请填写楼层,number:只能填数字" value="${data.floor!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">层中编号</label></div>
						<div class="field">
						<input type="text" class="input" id="room_num_in_floor" name="room.num_in_floor" size="200" placeholder="请填写层中编号" data-validate="required:请填写层中编号" value="${data.num_in_floor!""}"/>
						</div>
					</div>
				<div class="form-button"><button class="button bg-main" type="submit" onclick="return check()">提交</button></div>
			    </form>
			</div>
		</div>
	</div>
</div>
<?  } ?>			